package org.example.infrastructure.repository.orm.database;

import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.example.domain.model.entity.url.UrlShortenerLocaleStats;
import org.example.domain.model.entity.url.req.UrlShortenerGroupStatsReq;
import org.example.domain.model.entity.url.req.UrlShortenerStatsReq;
import org.example.domain.repository.UrlShortenerLocaleStatsRepository;
import org.example.infrastructure.persistence.orm.UrlShortenerLocaleStatsMapper;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
@Slf4j
@RequiredArgsConstructor
public class MybatisUrlShortenerLocaleStatsRepository implements UrlShortenerLocaleStatsRepository {
    private final UrlShortenerLocaleStatsMapper urlShortenerLocaleStatsMapper;

    @Override
    public void insertUrlShortenerLocaleStats(UrlShortenerLocaleStats urlShortenerLocaleStats) {
        urlShortenerLocaleStatsMapper.insertUrlShortenerLocaleStats(urlShortenerLocaleStats);
    }

    @Override
    public List<UrlShortenerLocaleStats> localeListByUrlShortener(UrlShortenerStatsReq urlShortenerStatsReq) {
        return urlShortenerLocaleStatsMapper.localeListByUrlShortener(urlShortenerStatsReq);
    }

    @Override
    public List<UrlShortenerLocaleStats> urlShortenerLocaleStatsByGroupList(UrlShortenerGroupStatsReq urlShortenerGroupStatsReq) {
        return urlShortenerLocaleStatsMapper.urlShortenerLocaleStatsByGroupList(urlShortenerGroupStatsReq);
    }
}
